<?php
	  class Update extends Controller
	  {
		  function Update(){
			  
			 parent::Controller();
			 $this->load->helper('form');
			 $this->load->helper('url');
			 $this->load->database();
		  }
		   function index()
		   {	
		   
		   		
		   		$this->db->where('newsid',$this->uri->segment(3));
				$data['query']=$this->db->get('gaoji_news');
				$this->load->view('admin_update',$data);
		   	//$this->load->model('updateModel');
			
				//$this->load->view('admin_update');
			}
			function update_news()
			{
				$data=$_POST;
				
			print_r($data);
			
			
				
				
				$this->db->where('newsid', $data['newsid']);
				unset($data['newsid']);

				$x=$this->db->update('gaoji_news',$data);
				echo $x;
				//$this->db->set($data);
				//$this->db->insert('gaoji_news'); 
				
			}
	  }

?>